package com.spring.shops.admin.controller.shop;

import com.spring.shops.model.entity.TzArea;
import com.spring.shops.model.result.ServerResponseEntityVoid;
import com.spring.shops.model.vo.AreaVO;
import com.spring.shops.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/area")
public class AreaController {
    @Autowired
    private AreaService areaService;

    /**
     * 递归获取所有的省县区
     * @param pid
     * @return
     */
    @GetMapping("/listByPid")
    public ServerResponseEntityVoid<List<TzArea>> getArea(String pid){
        System.out.println("hello");
        return areaService.getArea(pid);
    }
}
